package ar.org.cfired.creditos.abm;
import java.io.Serializable;
import java.util.HashMap;

public class Formulario extends Entidad implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String frm_nombre;
	private String frm_descripcion;
	private String OBJNAME_;
	private String NAME_;
	
	public void setFrmNombre (String frm_nombre) {
		if (frm_nombre != null)
			this.frm_nombre = frm_nombre.substring(0, Math.min(255, frm_nombre.length()));
		else
			this.frm_nombre = new String();
	}
	public String getFrmNombre() {
		return (this.frm_nombre);
	}

	public void setFrmDescripcion (String frm_descripcion) {
		if (frm_descripcion != null)
			this.frm_descripcion = frm_descripcion.substring(0, Math.min(255, frm_descripcion.length()));
		else
			this.frm_descripcion = new String();
	}
	public String getFrmDescripcion() {
		return (this.frm_descripcion);
	}

	public void setOBJNAME (String OBJNAME_) {
		if (OBJNAME_ != null)
			this.OBJNAME_ = OBJNAME_.substring(0, Math.min(255, OBJNAME_.length()));
		else
			this.OBJNAME_ = new String();
	}
	public String getOBJNAME() {
		return (this.OBJNAME_);
	}

	public void setNAME (String NAME_) {
		if (NAME_ != null)
			this.NAME_ = NAME_.substring(0, Math.min(255, NAME_.length()));
		else
			this.NAME_ = new String();
	}
	public String getNAME() {
		return (this.NAME_);
	}
	
	
	

	
	@Override
	public String getCriterioBusqueda2() {
		String busqueda = " from Formulario ";
		boolean filtro = false;
		//ArrayList a = new ArrayList();
		
		if(this.getFrmNombre() != null){
			if(!filtro){
				busqueda += " where " + " frm_nombre = " + this.getFrmNombre();
			filtro = true;
			}
			else
				busqueda += " and " + " frm_nombre = " + this.getFrmNombre();
		}
		
		if(this.getFrmDescripcion() != null){
			if(!filtro){
				busqueda += " where " + " frm_descripcion = " + this.getFrmDescripcion();
			filtro = true;
			}
			else
				busqueda += " and " + " frm_descripcion = " + this.getFrmDescripcion();
		}
		
		if(this.getOBJNAME() != null){
			if(!filtro){
				busqueda += " where " + "OBJNAME_ = " + this.getOBJNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "OBJNAME_ = " + this.getOBJNAME();
		}

		if(this.getNAME() != null){
			if(!filtro){
				busqueda += " where " + "NAME_ = " + this.getNAME();
			filtro = true;
			}
			else
				busqueda += " and " + "NAME_ = " + this.getNAME();
		}
	
		return  busqueda;
		}
	
	@Override
	public void setVariables(HashMap<String, Object> variables) {
		// TODO Auto-generated method stub
		
	}
	

}
